\hypertarget{a00066}{}\section{E\+:/knet-\/git/knet/knet/framework\+\_\+worker.h 文件参考}
\label{a00066}\index{E\+:/knet-\/git/knet/knet/framework\+\_\+worker.\+h@{E\+:/knet-\/git/knet/knet/framework\+\_\+worker.\+h}}
{\ttfamily \#include \char`\"{}config.\+h\char`\"{}}\\*
\subsection*{函数}
\begin{DoxyCompactItemize}
\item 
\hyperlink{a00056_af2a7f5b8406de73682f8bd4c2afee783_af2a7f5b8406de73682f8bd4c2afee783}{kframework\+\_\+worker\+\_\+t} $\ast$ \hyperlink{a00066_a032b3c34db5de1a62a8bcf5ca9ebe1f8_a032b3c34db5de1a62a8bcf5ca9ebe1f8}{knet\+\_\+framework\+\_\+worker\+\_\+create} (\hyperlink{a00056_a3195a3be35782fc1efb920c811be111d_a3195a3be35782fc1efb920c811be111d}{kframework\+\_\+t} $\ast$f, \hyperlink{a00056_a97fc76209a58362019f1ded9169e397f_a97fc76209a58362019f1ded9169e397f}{kloop\+\_\+t} $\ast$loop)
\begin{DoxyCompactList}\small\item\em 建立框架工作线程 \end{DoxyCompactList}\item 
void \hyperlink{a00066_a062cc63d020aca69e4434f95ffe8403c_a062cc63d020aca69e4434f95ffe8403c}{knet\+\_\+framework\+\_\+worker\+\_\+destroy} (\hyperlink{a00056_af2a7f5b8406de73682f8bd4c2afee783_af2a7f5b8406de73682f8bd4c2afee783}{kframework\+\_\+worker\+\_\+t} $\ast$worker)
\begin{DoxyCompactList}\small\item\em 销毁框架工作线程 \end{DoxyCompactList}\item 
int \hyperlink{a00066_aeb6f9a3c96da0c33695534a460e8f756_aeb6f9a3c96da0c33695534a460e8f756}{knet\+\_\+framework\+\_\+worker\+\_\+start} (\hyperlink{a00056_af2a7f5b8406de73682f8bd4c2afee783_af2a7f5b8406de73682f8bd4c2afee783}{kframework\+\_\+worker\+\_\+t} $\ast$worker)
\begin{DoxyCompactList}\small\item\em 启动框架工作线程 \end{DoxyCompactList}\item 
void \hyperlink{a00066_a6465eaddfbf6bfa8c7d54b489eb43462_a6465eaddfbf6bfa8c7d54b489eb43462}{knet\+\_\+framework\+\_\+worker\+\_\+stop} (\hyperlink{a00056_af2a7f5b8406de73682f8bd4c2afee783_af2a7f5b8406de73682f8bd4c2afee783}{kframework\+\_\+worker\+\_\+t} $\ast$worker)
\begin{DoxyCompactList}\small\item\em 关闭框架工作线程 \end{DoxyCompactList}\item 
void \hyperlink{a00066_a74b264bfdb937045c6e1d72e12603403_a74b264bfdb937045c6e1d72e12603403}{knet\+\_\+framework\+\_\+worker\+\_\+wait\+\_\+for\+\_\+stop} (\hyperlink{a00056_af2a7f5b8406de73682f8bd4c2afee783_af2a7f5b8406de73682f8bd4c2afee783}{kframework\+\_\+worker\+\_\+t} $\ast$worker)
\begin{DoxyCompactList}\small\item\em 等待框架工作线程关闭 \end{DoxyCompactList}\item 
\hyperlink{a00056_a846172ea4e8a86449eca41a3d8e074b7_a846172ea4e8a86449eca41a3d8e074b7}{ktimer\+\_\+t} $\ast$ \hyperlink{a00066_a0599b3e991b6545e3070aa8414b9c0f3_a0599b3e991b6545e3070aa8414b9c0f3}{knet\+\_\+framework\+\_\+worker\+\_\+create\+\_\+timer} (\hyperlink{a00056_af2a7f5b8406de73682f8bd4c2afee783_af2a7f5b8406de73682f8bd4c2afee783}{kframework\+\_\+worker\+\_\+t} $\ast$worker)
\begin{DoxyCompactList}\small\item\em 建立一个定时器 \end{DoxyCompactList}\item 
\hyperlink{a00056_ad0ada5642d10ce71bdd90816182f9b79_ad0ada5642d10ce71bdd90816182f9b79}{thread\+\_\+id\+\_\+t} \hyperlink{a00066_a9697af110fe414bbf4031b3e06528b02_a9697af110fe414bbf4031b3e06528b02}{knet\+\_\+framework\+\_\+worker\+\_\+get\+\_\+id} (\hyperlink{a00056_af2a7f5b8406de73682f8bd4c2afee783_af2a7f5b8406de73682f8bd4c2afee783}{kframework\+\_\+worker\+\_\+t} $\ast$worker)
\begin{DoxyCompactList}\small\item\em 取得工作线程\+I\+D \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{函数说明}
\hypertarget{a00066_a032b3c34db5de1a62a8bcf5ca9ebe1f8_a032b3c34db5de1a62a8bcf5ca9ebe1f8}{}\index{framework\+\_\+worker.\+h@{framework\+\_\+worker.\+h}!knet\+\_\+framework\+\_\+worker\+\_\+create@{knet\+\_\+framework\+\_\+worker\+\_\+create}}
\index{knet\+\_\+framework\+\_\+worker\+\_\+create@{knet\+\_\+framework\+\_\+worker\+\_\+create}!framework\+\_\+worker.\+h@{framework\+\_\+worker.\+h}}
\subsubsection[{knet\+\_\+framework\+\_\+worker\+\_\+create}]{\setlength{\rightskip}{0pt plus 5cm}{\bf kframework\+\_\+worker\+\_\+t}$\ast$ knet\+\_\+framework\+\_\+worker\+\_\+create (
\begin{DoxyParamCaption}
\item[{{\bf kframework\+\_\+t} $\ast$}]{f, }
\item[{{\bf kloop\+\_\+t} $\ast$}]{loop}
\end{DoxyParamCaption}
)}\label{a00066_a032b3c34db5de1a62a8bcf5ca9ebe1f8_a032b3c34db5de1a62a8bcf5ca9ebe1f8}


建立框架工作线程 


\begin{DoxyParams}{参数}
{\em f} & kframework\+\_\+t实例 \\
\hline
{\em loop} & kloop\+\_\+t实例 \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{返回}
kframework\+\_\+worker\+\_\+t实例 
\end{DoxyReturn}
\hypertarget{a00066_a0599b3e991b6545e3070aa8414b9c0f3_a0599b3e991b6545e3070aa8414b9c0f3}{}\index{framework\+\_\+worker.\+h@{framework\+\_\+worker.\+h}!knet\+\_\+framework\+\_\+worker\+\_\+create\+\_\+timer@{knet\+\_\+framework\+\_\+worker\+\_\+create\+\_\+timer}}
\index{knet\+\_\+framework\+\_\+worker\+\_\+create\+\_\+timer@{knet\+\_\+framework\+\_\+worker\+\_\+create\+\_\+timer}!framework\+\_\+worker.\+h@{framework\+\_\+worker.\+h}}
\subsubsection[{knet\+\_\+framework\+\_\+worker\+\_\+create\+\_\+timer}]{\setlength{\rightskip}{0pt plus 5cm}{\bf ktimer\+\_\+t}$\ast$ knet\+\_\+framework\+\_\+worker\+\_\+create\+\_\+timer (
\begin{DoxyParamCaption}
\item[{{\bf kframework\+\_\+worker\+\_\+t} $\ast$}]{worker}
\end{DoxyParamCaption}
)}\label{a00066_a0599b3e991b6545e3070aa8414b9c0f3_a0599b3e991b6545e3070aa8414b9c0f3}


建立一个定时器 


\begin{DoxyParams}{参数}
{\em worker} & kframework\+\_\+worker\+\_\+t实例 \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{返回}
ktimer\+\_\+t实例 
\end{DoxyReturn}
\hypertarget{a00066_a062cc63d020aca69e4434f95ffe8403c_a062cc63d020aca69e4434f95ffe8403c}{}\index{framework\+\_\+worker.\+h@{framework\+\_\+worker.\+h}!knet\+\_\+framework\+\_\+worker\+\_\+destroy@{knet\+\_\+framework\+\_\+worker\+\_\+destroy}}
\index{knet\+\_\+framework\+\_\+worker\+\_\+destroy@{knet\+\_\+framework\+\_\+worker\+\_\+destroy}!framework\+\_\+worker.\+h@{framework\+\_\+worker.\+h}}
\subsubsection[{knet\+\_\+framework\+\_\+worker\+\_\+destroy}]{\setlength{\rightskip}{0pt plus 5cm}void knet\+\_\+framework\+\_\+worker\+\_\+destroy (
\begin{DoxyParamCaption}
\item[{{\bf kframework\+\_\+worker\+\_\+t} $\ast$}]{worker}
\end{DoxyParamCaption}
)}\label{a00066_a062cc63d020aca69e4434f95ffe8403c_a062cc63d020aca69e4434f95ffe8403c}


销毁框架工作线程 


\begin{DoxyParams}{参数}
{\em worker} & kframework\+\_\+worker\+\_\+t实例 \\
\hline
\end{DoxyParams}
\hypertarget{a00066_a9697af110fe414bbf4031b3e06528b02_a9697af110fe414bbf4031b3e06528b02}{}\index{framework\+\_\+worker.\+h@{framework\+\_\+worker.\+h}!knet\+\_\+framework\+\_\+worker\+\_\+get\+\_\+id@{knet\+\_\+framework\+\_\+worker\+\_\+get\+\_\+id}}
\index{knet\+\_\+framework\+\_\+worker\+\_\+get\+\_\+id@{knet\+\_\+framework\+\_\+worker\+\_\+get\+\_\+id}!framework\+\_\+worker.\+h@{framework\+\_\+worker.\+h}}
\subsubsection[{knet\+\_\+framework\+\_\+worker\+\_\+get\+\_\+id}]{\setlength{\rightskip}{0pt plus 5cm}{\bf thread\+\_\+id\+\_\+t} knet\+\_\+framework\+\_\+worker\+\_\+get\+\_\+id (
\begin{DoxyParamCaption}
\item[{{\bf kframework\+\_\+worker\+\_\+t} $\ast$}]{worker}
\end{DoxyParamCaption}
)}\label{a00066_a9697af110fe414bbf4031b3e06528b02_a9697af110fe414bbf4031b3e06528b02}


取得工作线程\+I\+D 


\begin{DoxyParams}{参数}
{\em worker} & kframework\+\_\+worker\+\_\+t实例 \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{返回}
工作线程\+I\+D 
\end{DoxyReturn}
\hypertarget{a00066_aeb6f9a3c96da0c33695534a460e8f756_aeb6f9a3c96da0c33695534a460e8f756}{}\index{framework\+\_\+worker.\+h@{framework\+\_\+worker.\+h}!knet\+\_\+framework\+\_\+worker\+\_\+start@{knet\+\_\+framework\+\_\+worker\+\_\+start}}
\index{knet\+\_\+framework\+\_\+worker\+\_\+start@{knet\+\_\+framework\+\_\+worker\+\_\+start}!framework\+\_\+worker.\+h@{framework\+\_\+worker.\+h}}
\subsubsection[{knet\+\_\+framework\+\_\+worker\+\_\+start}]{\setlength{\rightskip}{0pt plus 5cm}int knet\+\_\+framework\+\_\+worker\+\_\+start (
\begin{DoxyParamCaption}
\item[{{\bf kframework\+\_\+worker\+\_\+t} $\ast$}]{worker}
\end{DoxyParamCaption}
)}\label{a00066_aeb6f9a3c96da0c33695534a460e8f756_aeb6f9a3c96da0c33695534a460e8f756}


启动框架工作线程 


\begin{DoxyParams}{参数}
{\em worker} & kframework\+\_\+worker\+\_\+t实例 \\
\hline
\end{DoxyParams}

\begin{DoxyRetVals}{返回值}
{\em error\+\_\+ok} & 成功 \\
\hline
{\em 其他} & 失败 \\
\hline
\end{DoxyRetVals}
\hypertarget{a00066_a6465eaddfbf6bfa8c7d54b489eb43462_a6465eaddfbf6bfa8c7d54b489eb43462}{}\index{framework\+\_\+worker.\+h@{framework\+\_\+worker.\+h}!knet\+\_\+framework\+\_\+worker\+\_\+stop@{knet\+\_\+framework\+\_\+worker\+\_\+stop}}
\index{knet\+\_\+framework\+\_\+worker\+\_\+stop@{knet\+\_\+framework\+\_\+worker\+\_\+stop}!framework\+\_\+worker.\+h@{framework\+\_\+worker.\+h}}
\subsubsection[{knet\+\_\+framework\+\_\+worker\+\_\+stop}]{\setlength{\rightskip}{0pt plus 5cm}void knet\+\_\+framework\+\_\+worker\+\_\+stop (
\begin{DoxyParamCaption}
\item[{{\bf kframework\+\_\+worker\+\_\+t} $\ast$}]{worker}
\end{DoxyParamCaption}
)}\label{a00066_a6465eaddfbf6bfa8c7d54b489eb43462_a6465eaddfbf6bfa8c7d54b489eb43462}


关闭框架工作线程 


\begin{DoxyParams}{参数}
{\em worker} & kframework\+\_\+worker\+\_\+t实例 \\
\hline
\end{DoxyParams}
\hypertarget{a00066_a74b264bfdb937045c6e1d72e12603403_a74b264bfdb937045c6e1d72e12603403}{}\index{framework\+\_\+worker.\+h@{framework\+\_\+worker.\+h}!knet\+\_\+framework\+\_\+worker\+\_\+wait\+\_\+for\+\_\+stop@{knet\+\_\+framework\+\_\+worker\+\_\+wait\+\_\+for\+\_\+stop}}
\index{knet\+\_\+framework\+\_\+worker\+\_\+wait\+\_\+for\+\_\+stop@{knet\+\_\+framework\+\_\+worker\+\_\+wait\+\_\+for\+\_\+stop}!framework\+\_\+worker.\+h@{framework\+\_\+worker.\+h}}
\subsubsection[{knet\+\_\+framework\+\_\+worker\+\_\+wait\+\_\+for\+\_\+stop}]{\setlength{\rightskip}{0pt plus 5cm}void knet\+\_\+framework\+\_\+worker\+\_\+wait\+\_\+for\+\_\+stop (
\begin{DoxyParamCaption}
\item[{{\bf kframework\+\_\+worker\+\_\+t} $\ast$}]{worker}
\end{DoxyParamCaption}
)}\label{a00066_a74b264bfdb937045c6e1d72e12603403_a74b264bfdb937045c6e1d72e12603403}


等待框架工作线程关闭 


\begin{DoxyParams}{参数}
{\em worker} & kframework\+\_\+worker\+\_\+t实例 \\
\hline
\end{DoxyParams}
